﻿using Prism.Ioc;
using Prism.Unity;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using PassingParameters.Views;
using System.Windows;
using Prism.Modularity;
using Prism.Mvvm;
using PassingParameters.ViewModels;

namespace PassingParameters
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : PrismApplication
    {
        protected override Window CreateShell()
        {
            return Container.Resolve<MainWidonw>();
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {

        }
        protected override IModuleCatalog CreateModuleCatalog()
        {
            return new ConfigurationModuleCatalog();
        }
        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            //Type type = typeof(ModuleA.ModuleAModule);
            //ModuleInfo moduleInfo = new ModuleInfo()
            //{
            //    ModuleName = "ModuleA",
            //    ModuleType = type.AssemblyQualifiedName,
            //    InitializationMode = InitializationMode.OnDemand//使用此模式时，需要自行加载Module
            //};
            //moduleCatalog.AddModule(moduleInfo);
        }
        protected override void ConfigureViewModelLocator()
        {
            base.ConfigureViewModelLocator();
            ViewModelLocationProvider.Register<MainWidonw, MainWindonwViewModel>();
        }
    }
}
